import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
export const columns: BasicColumn[] = [
  {
    title: '编码',
    dataIndex: 'code',
    align: 'left',
    ellipsis: true,
    resizable: true,
  },
  {
    title: '名称',
    dataIndex: 'name',
    align: 'left',
    ellipsis: true,
    resizable: true,
  },
  {
    title: '描述',
    dataIndex: 'description',
    align: 'left',
    ellipsis: true,
    resizable: true,
  },
  {
    title: '类型',
    dataIndex: 'kind',
    align: 'left',
    ellipsis: true,
    resizable: true,
    customRender: ({ record }) => {
      return record['code'] == record['formCode'] ? '主模块' : '副模块';
    },
  },
  {
    title: '状态',
    dataIndex: 'isUse',
    align: 'left',
    ellipsis: true,
    resizable: true,
    customRender: ({ text }) => {
      return text == 1 ? '启用' : '停用';
    },
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'name',
    label: '名称',
    component: 'Input',
    colProps: { span: 6 },
  },
];

export const formSchema: FormSchema[] = [
  {
    field: 'name',
    label: '名称',
    required: true,
    component: 'Input',
    colProps: { span: 22 },
  },
];

export const syncFormSchema: FormSchema[] = [
  {
    field: 'cols',
    label: '同步',
    component: 'Input',
    colProps: { span: 22 },
    slot: 'cols',
  },
  {
    field: 'byModuleCode',
    label: '模块',
    component: 'Input',
    colProps: { span: 22 },
    slot: 'byModuleCode',
  },
  {
    field: '',
    label: ' ',
    component: 'Input',
    colProps: { span: 22 },
    render: () => {
      return '(同步后，本模块将变为与选择的模块一致)';
    },
  },
];
